<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>作品数据</title>
    <link rel="icon" href="../../img/logoimg.png" type="image/ico">
</head>
<script type="text/javascript" src="../../js/jquery-3.6.0.min.js"></script>
<style>
    small{
        font-size: 10px;
        color: grey;
    }
    ul{
        width: 300px;
        height: 200px;
        float: left;
    }
    ul a{
        float: left;
        padding-bottom: 1%;
    }
</style>
<body style="background: #f7f1e3;">
<div class="empty" th:onload="|queryAuthorByUid()|">
    <th:block th:if="${author.blist.size()==0}">
        <div style="text-align: center">
            <br>
            <img src="../../img/qidai.png" width="80px;" height="80px;"/><br>
            您还没有作品哦~  期待您的创作
        </div>
    </th:block>
</div>
<th:block th:if="${author.blist.size()>0}" th:each="b:${bookList}">
    <ul style="list-style-type:none;">
        <li>
            <a href="#">
                <img th:if="${b.fileInfo==null}" src="../../img/logo.jpg" alt="书籍封面" width="100px;" height="150px;" >
                <img th:if="${b.fileInfo!=null}" th:src="'../../upload/'+${b.fileInfo.fUrl}" alt="书籍封面" width="100px;" height="150px;" >
                <a th:text="${b.blName}" style="font-weight: bold;"></a><br><br>
                <a style="color: grey; font-size: small" th:if="${b.blSpeed==1}">连载中&nbsp;&nbsp;</a>
                <a style="color: black; font-size: small" class="small" th:if="${b.blSpeed!=1}">完结&nbsp;&nbsp;</a>
                <a style="color: grey; font-size: small" th:if="${b.blSignstatus==1}">未签约</a>
                <a style="color: green; font-size: small" th:if="${b.blSignstatus==2}">申请签约中</a>
                <a style="color: red; font-size: small" th:if="${b.blSignstatus==3}">已签约</a>
                <a style="color: grey; font-size: small" th:if="${b.blSignstatus==4}">签约失败</a><br><br>
                <a>点击量：<span class="small" th:text="${b.blCount}"></span></a><br><br>
                <a th:onclick="|queryShelfNum(${b.blId})|" style="cursor: pointer; color: blue;">
                    点击查看收藏量</a><br>
            </a>
        </li>
    </ul>
</th:block>

</body>
<script>
    function queryShelfNum(blId){
        $.ajax({
            url:"queryShelfNum",
            type:"post",
            dataType:"text",
            data:{"blId":blId},
            success:function (data){
                alert("您好，本书的收藏量为：" + data);
            },error:function (){
                alert("查询收藏失败，请重试");
            }
        })
    }

</script>
</html>